package projetolions;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Doação.java
 *
 * Created on 12/07/2011, 14:23:07
 */

/**
 *
 * @author rti dev-02
 */
public class Doação extends javax.swing.JFrame {

    /** Creates new form Doação */
    public Doação() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jbNovo = new javax.swing.JButton();
        jbConsultar = new javax.swing.JButton();
        jbSalvar = new javax.swing.JButton();
        jbExcluir = new javax.swing.JButton();
        jbInicio = new javax.swing.JButton();
        jbAnterior = new javax.swing.JButton();
        jbProximo = new javax.swing.JButton();
        jbFinal = new javax.swing.JButton();
        jlNome = new javax.swing.JLabel();
        jlSobreNome = new javax.swing.JLabel();
        jlSobreNome1 = new javax.swing.JLabel();
        jcbMaterialdoado = new javax.swing.JComboBox();
        jtfNomeDoador = new javax.swing.JTextField();
        jlObservacao = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtaObservation = new javax.swing.JTextArea();
        jdcDataDoaçao = new com.toedter.calendar.JDateChooser();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jbNovo.setText("Novo");

        jbConsultar.setText("Consultar");

        jbSalvar.setText("Salvar");
        jbSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Salvar(evt);
            }
        });

        jbExcluir.setText("Excluir");

        jbInicio.setText("<");

        jbAnterior.setText("<<");

        jbProximo.setText(">>");

        jbFinal.setText(">");

        jlNome.setText("Nome do Doador:");

        jlSobreNome.setText("Material Doado:");

        jlSobreNome1.setText("Data da Doação:");

        jcbMaterialdoado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione o Material" }));

        jlObservacao.setText("Observação:");

        jtaObservation.setColumns(20);
        jtaObservation.setRows(5);
        jScrollPane1.setViewportView(jtaObservation);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(22, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jlSobreNome1)
                    .addComponent(jlSobreNome)
                    .addComponent(jlNome)
                    .addComponent(jbNovo, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jbConsultar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbExcluir, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbInicio, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(jbAnterior)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbProximo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jbFinal, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jcbMaterialdoado, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfNomeDoador, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jdcDataDoaçao, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addComponent(jlObservacao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(345, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbNovo)
                    .addComponent(jbConsultar)
                    .addComponent(jbSalvar)
                    .addComponent(jbExcluir)
                    .addComponent(jbProximo)
                    .addComponent(jbAnterior)
                    .addComponent(jbInicio)
                    .addComponent(jbFinal))
                .addGap(45, 45, 45)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlNome)
                    .addComponent(jtfNomeDoador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlSobreNome)
                    .addComponent(jcbMaterialdoado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jlSobreNome1)
                    .addComponent(jdcDataDoaçao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlObservacao))
                .addContainerGap(84, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void Salvar(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Salvar

        Obj_Doacao a = new Obj_Doacao();

        a.setNomeDoador(this.jtfNomeDoador.getText());
        a.setMaterialDoado(String.valueOf(this.jcbMaterialdoado.getSelectedItem()));
        a.setDataDoacao(this.jdcDataDoaçao.getDate());
        a.setObs(this.jtaObservation.getText());
        

    }//GEN-LAST:event_Salvar

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Doação().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbAnterior;
    private javax.swing.JButton jbConsultar;
    private javax.swing.JButton jbExcluir;
    private javax.swing.JButton jbFinal;
    private javax.swing.JButton jbInicio;
    private javax.swing.JButton jbNovo;
    private javax.swing.JButton jbProximo;
    private javax.swing.JButton jbSalvar;
    private javax.swing.JComboBox jcbMaterialdoado;
    private com.toedter.calendar.JDateChooser jdcDataDoaçao;
    private javax.swing.JLabel jlNome;
    private javax.swing.JLabel jlObservacao;
    private javax.swing.JLabel jlSobreNome;
    private javax.swing.JLabel jlSobreNome1;
    private javax.swing.JTextArea jtaObservation;
    private javax.swing.JTextField jtfNomeDoador;
    // End of variables declaration//GEN-END:variables

}
